<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    function a() {
        var a = "a";
        // ....
        a = a+1;
        this.a = a;
    }

    function b() {
        console.log(this.a)
    }

    a();
    b();
</script>
</html>